#ifndef PROPERTYBOARD_H
#define PROPERTYBOARD_H

#include <BMenu>
#include <BLineEdit>
#include <BCheckBox>
#include <BTableWidget>
#include <BHtmlWidget>
#include <BComboBox>
#include <BTextEdit>
#include <BButton>
#include <BGroupBox>

using namespace BWE;

class PropertyBoard : public BGroupBox
{
	BOBJECT(PropertyBoard)
public:
	PropertyBoard(BWidget* parent = 0);
	~PropertyBoard();

protected:
	void syncWidgets();
	void freshRowLabels(int row);

protected:
	void slotAssetChanged(BObject* sender, const BValue& value);

	void slotHtmlWidgetEditable(BObject* sender, const BValue& value);
	void slotHtmlItemSelected(BObject* sender, const BValue& value);
	void slotHtmlItemTextChanged(BObject* sender, const BValue& value);

	void slotNameEditFinished(BObject* sender, const BValue& value);
	void slotComboCurrentChanged(BObject* sender, const BValue& value);
	void slotFormatEditFinished(BObject* sender, const BValue& value);

	void slotAttribItemSelected(BObject* sender, const BValue& value);
	void slotAttribItemRightClicked(BTableWidget* tableWidget, const BValue& value);
	void slotAttribItemDoubleClicked(BTableWidget* tableWidget, const BValue& value);
	void slotAttribTableResized(BTableWidget* tableWidget, const BValue& value);

	void slotAttribEditFinished(BObject* sender, const BValue& value);
	void slotAttribEditFocused(BObject* sender, const BValue& value);
	void slotBrowseButtonClicked(BObject* sender, const BValue& value);
	void slotAttribMenuTriggered(BObject* sender, const BValue& value);

	void slotPlainCheckBoxChecked(BObject* sender, const BValue& value);

protected:
	virtual void styleEvent(const BEvent& event);

private:
	BComboBox*			_encodeComboBox;
	BLineEdit*			_titleLineEdit;
	BLineEdit*			_styleSheetEdit;
	BComboBox*			_nameComboBox;
	BLineEdit*			_formatEdit;
	BTableWidget*		_attribTable;
	BTextEdit*			_textEdit;
	BCheckBox*			_plainCheckBox;
	BLineEdit*			_attribEdit;
	BMenuHolder			_attribsMenu;
	BButton*			_browseButton;

	BHolder<BHtmlWidget>	_htmlWidget;
	BHolder<BHtmlItem>		_htmlItem;
};

#endif